package test
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Matrix;
	import flash.net.URLRequest;
	
	import level4.gemo.TweenAnimationTransformX;

	public class TweenAnimationTransformXTest extends Sprite
	{
		public function TweenAnimationTransformXTest()
		{
			test();
		}
		
		private function test():void{
			var l:Loader = new Loader();
				l.load(new URLRequest("assets/TweenAni.swf"));
				l.contentLoaderInfo.addEventListener(Event.COMPLETE,onOk);
				
				/////////////
				//闭包
				////////////
		}
		private function onOk(e:Event):void{
			var l:Loader = e.target.loader;
			
			var tweenMc:MovieClip = (l.content as MovieClip).t;
			addChild(tweenMc);
			var targetMc:MovieClip = tweenMc.t;
			var startFrame:int = 0;
			var endFrame:int = 10;
			
			var mat:Matrix = new Matrix(-1);
			
			var tweenX:TweenAnimationTransformX = new TweenAnimationTransformX();
				tweenX.ApplyTransforms(startFrame,endFrame,tweenMc,targetMc,mat);
				tweenMc.play();
		}
	}
}